import { Point } from "/src/api/common";

export function leftView(chart: any, data: Array<Point>) {
    let optionData = [];
    let dataCasingOne = [];
    let dataCasingTwo = [];
    let dataCasingThree = [];
    data.forEach(element => {
        const x : number = element.X;
        const y : number = element.Y;
        const z : number = -element.Z;
        optionData.push([x, y, z]);
    });
    const option = {
        tooltip: {},
        backgroundColor: '#fff',
        visualMap: {
            show: false,
            dimension: 5,

            inRange: {},
        },
        xAxis3D: {
            type: 'value',
        },
        yAxis3D: {
            type: 'value',
        },
        zAxis3D: {
            type: 'value'
        },
        grid3D: {
            viewControl: {
                projection: 'orthographic',
            },
        },
        series: [
            {
                type: 'line3D',
                data: data,
                name: "井眼轨迹",
                lineStyle: {
                    width: 8,
                    color: '#000000',
                },
            },
            {
                type: 'line3D',
                data: dataCasingOne,
                name: "一开套管",
                lineStyle: {
                    width: 48,
                    opacity: 0.3,
                    color: '#00ff'
                },
            },
            {
                type: 'line3D',
                data: dataCasingTwo,
                name: "二开套管",
                lineStyle: {
                    width: 37,
                    opacity: 0.3,
                    color: '#FF0FFF'  // 设置为绿色
                },
            },
            {
                type: 'line3D',
                data: dataCasingThree,
                name: "三开套管",
                lineStyle: {
                    width: 24,
                    opacity: 0.3,
                    color: '#008000'  // 设置为绿色
                },
            },
        ]
    };
    chart.clear()
    chart.setOption(option);
}

export function rightView() {

}

export function topView() {

}

export function view() {

}